﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using StudentsManager.Models;

namespace StudentsManager.Forms
{
    public partial class ClassForm : Form
    {
        public Class QueryClass { get; set; }

        public ClassForm()
        {
            InitializeComponent();
        }

        public ClassForm(Class classObj)
        {
            InitializeComponent();
            txtClassName.Text = classObj.Name;
            txtClassDescription.Text = classObj.Description;
            txtSchoolName.Text = classObj.SchoolName;
        }

        private void btnQuery_Click(object sender, EventArgs e)
        {
            QueryClass = new Class
            {
                Name = txtClassName.Text,
                Description = txtClassDescription.Text,
                SchoolName = txtSchoolName.Text
            };
            DialogResult = DialogResult.OK;
            Close();
        }
    }
}
